package com.demo.camel01.hellocamel;

import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.log4j.PropertyConfigurator;

public class HelloCamelDemo {

    public static void main(String[] args) throws Exception {

        // 日志
        PropertyConfigurator.configure("src/conf/log4j.properties");
        PropertyConfigurator.configureAndWatch("src/conf/log4j.properties", 1000);

        CamelContext context = new DefaultCamelContext();
        context.start();

        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                System.out.println("hello camel");
            }
        });


        // 通用没有具体业务意义的代码，只是为了保证主线程不退出
        synchronized (HelloCamelDemo.class) {
            HelloCamelDemo.class.wait();
        }
    }
}
